/*arguments[]`   */
function foo(x,y,z) {
    console.log(x,y,z);
    arguments[0]=10
    arguments[2]=1
    console.log(x,y,z);
}
foo(1,2)
console.log("length:",foo.length,foo.name);
console.log();

function foo2(x,y,z) {
    "use strict"//严格模式
    console.log(x,y,z);
    arguments[0]=10
    arguments[2]=1
    console.log(x,y,z);
}
foo2(1,2)
console.log("length:",foo2.length,foo2.name);
console.log();

function foo3(x,y) {
    console.log(x,y,this);
    
}
foo3.call(100,1,2)
foo3.apply(true,[3,4])
foo3.apply(null)
console.log();
foo3.apply(undefined)
console.log();

function foo4(x,y) {
    "use strict"
    console.log(x,y,this);
    
}
foo4.apply(null)
console.log();
foo4.apply(undefined)
console.log();

this.x=9
var module={
    x:81,
    getX:function () {
        return this.x;
        
    }
};
console.log(module.getX());
var getX=module.getX

console.log(getX());
var boundGetX=getX.bind(module)

console.log(boundGetX);
console.log();

function add(a,b,c) {
    return a+b+c
    
}
var func=add.bind(undefined,100)

console.log(func(1,2));
var func2=func.bind(undefined,200)

console.log(func2(10));


